package com.dianping.cat.home.storage.alert.entity;

import com.dianping.cat.home.storage.alert.BaseEntity;
import com.dianping.cat.home.storage.alert.IVisitor;
import java.util.ArrayList;
import java.util.List;







public class Target
  extends BaseEntity<Target>
{
  private String m_id;
  private String m_title;
  private int m_level;
  private int m_count;
/*  21 */   private List<Detail> m_details = new ArrayList();





/*  27 */   public Target(String id) { this.m_id = id; }




  public void accept(IVisitor visitor) { visitor.visitTarget(this); }


  public Target addDetail(Detail detail) {
    this.m_details.add(detail);
/*  37 */     return this;
  }


  public boolean equals(Object obj) {
/*  42 */     if (obj instanceof Target) {
/*  43 */       Target _o = (Target)obj;

/*  45 */       if (!equals(getId(), _o.getId())) {
/*  46 */         return false;
      }

/*  49 */       return true;
    }

/*  52 */     return false;
  }

  public Detail findDetail(String content) {
/*  56 */     for (Detail detail : this.m_details) {
/*  57 */       if (!equals(detail.getContent(), content)) {
        continue;
      }

/*  61 */       return detail;
    }

/*  64 */     return null;
  }


/*  68 */   public int getCount() { return this.m_count; }



/*  72 */   public List<Detail> getDetails() { return this.m_details; }



/*  76 */   public String getId() { return this.m_id; }



/*  80 */   public int getLevel() { return this.m_level; }



/*  84 */   public String getTitle() { return this.m_title; }



  public int hashCode() {
/*  89 */     int hash = 0;

/*  91 */     return hash * 31 + ((this.m_id == null) ? 0 : this.m_id.hashCode());
  }



  public Target incCount() {
/*  97 */     this.m_count++;
/*  98 */     return this;
  }

  public Target incCount(int count) {
/* 102 */     this.m_count += count;
/* 103 */     return this;
  }


  public void mergeAttributes(Target other) {
/* 108 */     assertAttributeEquals(other, "target", "id", this.m_id, other.getId());

/* 110 */     if (other.getTitle() != null) {
/* 111 */       this.m_title = other.getTitle();
    }

/* 114 */     this.m_level = other.getLevel();

/* 116 */     this.m_count = other.getCount();
  }

  public Detail removeDetail(String content) {
/* 120 */     int len = this.m_details.size();

/* 122 */     for (int i = 0; i < len; ) {
/* 123 */       Detail detail = (Detail)this.m_details.get(i);

/* 125 */       if (!equals(detail.getContent(), content)) {
        i++;
        continue;
      }
/* 129 */       return (Detail)this.m_details.remove(i);
    }

/* 132 */     return null;
  }

  public Target setCount(int count) {
/* 136 */     this.m_count = count;
/* 137 */     return this;
  }

  public Target setId(String id) {
/* 141 */     this.m_id = id;
/* 142 */     return this;
  }

  public Target setLevel(int level) {
/* 146 */     this.m_level = level;
/* 147 */     return this;
  }

  public Target setTitle(String title) {
/* 151 */     this.m_title = title;
/* 152 */     return this;
  }

  public Target() {}
}


/* Location:              /Users/hanfei/Documents/apache-tomcat-9.0.24/webapps/cat/WEB-INF/classes/!/com/dianping/cat/home/storage/alert/entity/Target.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       1.0.7
 */